package com.james.controller;

import com.james.po.Car;
import com.james.service.CarService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class CarController {

    @Resource
    private CarService carService;

    /**
     * 查看所有车辆
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "/carlist",method = RequestMethod.GET)
    public List<Car> showAllCar(){
        List<Car> list=carService.selectAll();
        return list;
    }
}
